﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SaleOrderRequestList.ascx.cs" Inherits="Admin_Components_OrderRequest_SaleOrderRequestList" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<telerik:RadScriptManager ID="ScriptManager2" runat="server" EnableTheming="True">
</telerik:RadScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
       <%-- <telerik:radformdecorator id="QsfFromDecorator" runat="server" decoratedcontrols="All"
            enableroundedcorners="false" />--%>
        <telerik:RadTabStrip ID="TabStrip1" runat="server" EnableDragToReorder="true" Skin="Vista" MultiPageID="RadMultiPag1" SelectedIndex="1">
            <Tabs>
                <telerik:RadTab Text="THÔNG TIN TÌM KIẾM" Selected="True">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPag1" runat="server" SelectedIndex="0">
            <!--Tab thông tin chung -->
            <telerik:RadPageView ID="RadPageView1" runat="server" Height="220px" Style="overflow: hidden">
                 <fieldset class="form" id="fsGeneral">
                  <br />
                     <div class="form-horizontal wrapper-center clearfix">
                        <!--Block bên trái -->
                         <div class="form-group col-md-6">
                            <!--Dòng -->
                            <div class="form-group">
                                <label class="col-md-3 control-label">Tình trạng</label>
                                <div class="col-md-8">
                                     <telerik:RadComboBox ID="cboStatus" runat="server" CssClass="col-imp-8" />
                                </div>
                            </div>
                            <!--End Dòng -->
                             <!--Dòng -->
                            <div class="form-group">
                                <label class="col-md-3 control-label"> Mã đơn đặt hàng</label>
                                <div class="col-md-8">
                                    <telerik:RadTextBox ID="txtSaleOrderCode" CssClass="col-imp-8 inputForm" Width="70px" runat="server" />
                                </div>
                            </div>
                          <!--End Dòng -->
                           
                              <!--Dòng -->
                            <div class="form-group">
                                <label class="col-md-3 control-label">
                                   Người nhận hàng</label>
                                <div class="col-md-8">
                                    <telerik:RadTextBox ID="txtReceiptPerson" CssClass="col-imp-8 inputForm"  runat="server"/>
                                    
                                </div>
                            </div>
                             <div class="form-group">
                                <label class="col-md-3 control-label">
                                  Địa chỉ nhận hàng</label>
                                <div class="col-md-8">
                                    <telerik:RadTextBox ID="txtReceiptAdress" CssClass="col-imp-8 inputForm"  runat="server"/>
                                </div>
                            </div>
                             <div class="form-group">
                                <label class="col-md-3 control-label">
                                  Thời gian đặt hàng</label>
                                <div class="col-md-8">

                                <telerik:RadDatePicker ID="dtpFromDate" cssclass="col-imp-8" enabled="true" runat="server">
                                    <Calendar ID="Calendar1" runat="server" EnableKeyboardNavigation="true" ViewSelectorText="x" Skin="Hay" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False">
                                    </Calendar>
                                    <DateInput ToolTip="Từ ngày" style="width:100px" DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy"></DateInput>

                                </telerik:RadDatePicker>
                         
                                    <telerik:RadDatePicker ID="dtpToDate" cssclass="col-imp-8" enabled="true" runat="server">
                                    <Calendar ID="Calendar2" runat="server" EnableKeyboardNavigation="true" ViewSelectorText="x" Skin="Hay" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False">
                                    </Calendar>
                                    <DateInput ToolTip="Đến ngày" style="width:100px" DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy"></DateInput>

                                </telerik:RadDatePicker>
                                </div>
                            </div>
                        </div>
                         <!--Block bên phải -->
                        <div class="form-group col-md-6">
                            <div class="form-group">
                            <label class="col-md-3 control-label">Tỉnh thành</label>
                            <div class="col-md-8">
                                <telerik:RadComboBox ID="cboProvinceIDSearch" runat="server" CssClass="col-imp-8" OnSelectedIndexChanged="cboProvinceIDSearch_SelectedIndexChanged" AutoPostBack="true">  
                                </telerik:RadComboBox>
                             </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label">Cửa hàng</label>
                                <div class="col-md-8">
                                <telerik:RadComboBox ID="cboShop" runat="server" CssClass="col-imp-8" />
                                </div>
                            </div>
                             <!--Dòng -->
                            <div class="form-group">
                                <label class="col-md-3 control-label">Khách hàng</label>
                                <div class="col-md-8">
                                    <telerik:RadTextBox ID="txtCustomerName" CssClass="col-imp-8 inputForm" Style="width:50px" runat="server"  EmptyMessage="Mã hoặc tên hoặc số điện thoại"/>
                                 </div>
                            </div>
                            <!--End Dòng -->
                            <div class="form-group">
                            <label class="col-md-3 control-label">
                            Sản phẩm</label>
                            <div class="col-md-8">
                            <telerik:RadTextBox ID="txtProduct" CssClass="col-imp-8 inputForm"  runat="server" EmptyMessage="Mã hoặc tên sản phẩm"/>
                            
                            </div>
                            </div>
                             <div class="form-group">
                                <label class="col-md-3 control-label"> Điện thoại nhận hàng</label>
                                <div class="col-md-8">
                                    <telerik:RadTextBox ID="txtReceiptPhoneNumer" CssClass="col-imp-8 inputForm"  runat="server"/>
                                </div>
                            </div>

                    </div>
                </fieldset>
            </telerik:RadPageView>
        </telerik:RadMultiPage>

        <!--Action-->
        <div class="set-btns text-center">
            <asp:Button ID="btnSearch" CssClass="btn btn-sm btn-primary" runat="server" Text="Tìm kiếm" OnClick="btnSearch_Click"/>
            <asp:Button ID="btnReset" runat="server" CssClass="btn btn-sm btn-primary" Text="Nhập lại" OnClick="btnReset_Click"/>
        </div>
        <!--End Action -->
        <div class="row">
        <telerik:RadGrid ID="gv" runat="server" AutoGenerateColumns="False" CellSpacing="0"
            AllowMultiRowSelection="True" GridLines="None" HeaderStyle-HorizontalAlign="Center"
            HeaderStyle-BorderStyle="None" CssClass="table table-bordered" AllowPaging="true"
            PageSize="50" AllowCustomPaging="true" OnNeedDataSource="gvData_NeedDataSource" OnItemCommand="gvData_ItemCommand" OnItemDataBound="gv_ItemDataBound" >
            <MasterTableView AllowPaging="True" PageSize="50" EditMode="InPlace" ShowHeader="true"
                AutoGenerateColumns="False" NoMasterRecordsText="Không có dữ liệu.">
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="STT" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <%# Eval("RowID") %>
                    </ItemTemplate>
                    <HeaderStyle Width="50px" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridTemplateColumn>

                <telerik:GridTemplateColumn  HeaderText="Mã đơn đặt hàng" >
                    <ItemTemplate>
                        <asp:LinkButton ID="btnViewDetail" runat="server" ToolTip="Xem chi tiết đơn đặt hàng" Text='<%#Eval("SaleOrderRequestCode") %>' CommandArgument='<%# Eval("SaleOrderRequestID") %>'
                            CommandName="ViewItem"/>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" Font-Bold ="true"/>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn  DataField="SaleOrderRequestDate" UniqueName="SaleOrderRequestDate"  ReadOnly="true" HeaderText="Ngày đặt hàng">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn  DataField="ShopName" UniqueName="ShopName"  ReadOnly="true" HeaderText="Cửa hàng">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left"/>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn  DataField="CustomerName" UniqueName="CustomerName"  ReadOnly="true" HeaderText="Khách hàng">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="PhoneNumber" UniqueName="PhoneNumber"  ReadOnly="true" HeaderText="Điện thoại">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left"/>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn  DataField="TotalWeight" UniqueName="TotalWeight"  ReadOnly="true" HeaderText="Tổng trọng lượng" DataFormatString="{0:###,###}">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn  DataField="Total" UniqueName="Total"  ReadOnly="true" HeaderText="Tổng tiền" DataFormatString="{0:###,###}">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn  DataField="Status" UniqueName="Status"  ReadOnly="true" HeaderText="Tình trạng">
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn  DataField="StatusCode" UniqueName="StatusCode"  ReadOnly="true" Display="False">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn  HeaderText="Tạo đơn hàng" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Button ID="btnCreateOrder" runat="server" CssClass="btnAdd" CommandArgument='<%# Eval("SaleOrderRequestID") %>'
                            CommandName="CreateItem" Target="_blank"/>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="100px" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn  HeaderText="Xóa" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Button ID="btnDelete" runat="server" CssClass="btnX" CommandArgument='<%# Eval("SaleOrderRequestID") %>'
                            CommandName="DeleteItem" Target="_blank" OnClientClick="return ConfirmOnDelete('Bạn chắc chắn muốn xóa?')"/>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="80px" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn  HeaderText="Sửa" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Button ID="btnEdit" runat="server" CssClass="btnEdit" CommandArgument='<%# Eval("SaleOrderRequestID") %>'
                            CommandName="EditItem" Target="_blank"/>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="80px" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </ContentTemplate>
</asp:UpdatePanel>
<div class="progressbar">
    <asp:UpdateProgress ID="up" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div class="bg">
                <div class="progress progress-striped active">
                    <div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0"
                        aria-valuemax="100" style="width: 100%">
                        <span class="sr-only">100% Complete</span>
                    </div>
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
</div>
